package abstracttransactions

import (
	"fmt"
	"log"
	"salary/model"
)

/*
 * 更改支付方式
 */

type ChangeMethodTransaction struct {
	ChangeEmployeeTransaction
	Method
}

type Method interface{
	GetMethod() model.PaymentMethod
}

func (cmt *ChangeMethodTransaction) Change(employee *model.Employee) {
	pm := cmt.GetMethod()
	employee.SetMethod(pm)
}

func (cmt *ChangeMethodTransaction) Pay(pc model.PayCheck) {
	err := fmt.Errorf("The method or operation is not implemented.")
	log.Println(err.Error())
}
